<script setup>
//导入创建好的store
import useCounter from "@/pinia/counter";
//调用创建好的store
const counterStore = useCounter()

function add() {
  counterStore.incement(10)
}
</script>

<template>
  <div class="home">
    <h1>counter的值是：{{ counterStore.counter }}</h1>
    <h1>counter*2后的值是：{{ counterStore.doubleCount }}</h1>
    <button @click="counterStore.getData()">发起请求</button>
    <button @click="add">+1</button>
  </div>
</template>

<style scoped lang="less"></style>
